<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCmcPromotionPintuanTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cmc_promotion_pintuan', function (Blueprint $table) {
            $table->increments('pintuan_id');
            $table->integer('site_id')->nullable()->comment('店铺ID');
            $table->string('site_name')->nullable()->comment('店铺名称');
            $table->string('pintuan_name')->nullable()->comment('活动名称');
            $table->integer('goods_id')->nullable()->comment('商品ID');
            $table->integer('is_virtual_goods')->nullable()->comment('是否虚拟');
            $table->string('pintuan_num')->nullable()->comment('参团人数');
            $table->dateTime('pintuan_time')->nullable()->comment('拼团有效期');
            $table->string('remark')->nullable()->comment('备注');
            $table->integer('is_recommend')->nullable()->comment('是否推荐');
            $table->integer('start_time')->nullable()->comment('开始时间');
            $table->integer('end_time')->nullable()->comment('结束时间');
            $table->tinyInteger('buy_num')->nullable()->comment('拼团限制购买');
            $table->decimal('pintuan_price')->nullable()->comment('拼团价');
            $table->tinyInteger('is_virtual_buy')->nullable()->comment('是否虚拟成团');
            $table->tinyInteger('is_single_buy')->nullable()->comment('是否单独购买');
            $table->string('is_promotion')->nullable()->comment('是否团长优惠');
            $table->integer('group_num')->default('0')->nullable()->comment('开团组数');
            $table->integer('order_num')->default('0')->nullable()->comment('购买人数');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cmc_promotion_pintuan');
    }
}
